package cn.com.surker.material.entity;

import cn.com.surker.base.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 材料过磅表
 * </p>
 *
 * @author admin
 * @since 2024-06-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class MainMaterialWeight extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 标识
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 公司ID
     */
    @NotNull(message = "请选择公司")
    private Long orgId;

    /**
     * 供应商ID
     */
    @NotNull(message = "请选择供应商")
    private Long supplierId;

    /**
     * 过磅订单号
     */
    private String code;

    /**
     * 微信openid
     */
    private String openid;
    /**
     * 司机姓名
     */
    private String driver;
    /**
     * 电话
     */
    private String phone;

    /**
     * 供应商名称
     */
    private String supplier;

    /**
     * 供方单号
     */
    private String supplierOrderId;

    /**
     * 材料ID
     */
    @NotNull(message = "请选择材料")
    private Long materialId;
    /**
     * 材料名称
     */
    private String material;

    /**
     * 过磅重量(1原材2辅材3商砼退料4砼过磅5登记皮重6原材出售过磅0其它过磅)
     */
    @NotNull(message = "请选择过磅类型")
    private Integer weightType;

    /**
     * 车辆类型(类型  1是搅拌车,2是材料车,3是外运车,4是水稳层,5其他,6内转车
     */
    private Integer carType;

    /**
     * 车牌号
     */
    private String carNo;

    /**
     * 仓位ID
     */
    @NotNull(message = "请选择仓位")
    private Long storageId;

    /**
     * 供方毛重
     */
    private Double supplierGross;

    /**
     * 供方净重
     */
    private Double supplierNetWeight;

    /**
     * 供方皮重
     */
    private Double supplierTare;
    /**
     * 供应商票据号
     */
    private String supplierCode;

    /**
     * 真实毛重
     */
    private Double realGross;

    /**
     * 真实净重
     */
    private Double realNetWeight;
    /**
     * 毛重
     */
    private Double gross;

    /**
     * 净重
     */
    private Double netWeight;

    /**
     * 皮重
     */
    private Double tare;

    /**
     * 扣除重量
     */
    private Double deductWeight;

    /**
     * 暗扣重量
     */
    private Double hiddenWeight;

    /**
     * 明扣
     */
    private Double brightWeight;

    /**
     * 显示扣除比例(应对超限检查，扣除显示比例值,界面中的毛重-毛重*比例)
     */
    private Double displayRate;

    /**
     * 是否打印(0:未打印1:已打印)
     */
    private Integer isPrint;

    /**
     * 是否显示(0:不显示1:显示)
     */
    private Integer isDisplay;

    /**
     * 入磅设备编号
     */
    private String inDevice;
    /**
     * 出磅设备编号
     */
    private String outDevice;

    /**
     * 入场时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date inTime;

    /**
     * 出场时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date outTime;

    /**
     * 打印时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date printTime;

    /**
     * 是否自动(0:自动1:人工)
     */
    private Integer isAuto;

    /**
     * 是否结算(0:是1:否)
     */
    private Integer isBill;

    /**
     * 是否审核(0:已审核1:未审核)
     */
    private Integer isCheck;

    /**
     * 审核人
     */
    private String checker;

    /**
     * 财务审核
     */
    private Integer isFinance;

    /**
     * 财务审核人
     */
    private String finance;

    /**
     * 发货单ID
     */
    private Long invoiceId;

    /**
     * 是否计算库存
     */
    private Integer isStore;

    public MainMaterialWeight(){}

    public MainMaterialWeight(Long orgId, Long supplierId, String code, String openid, String driver, String phone,
                              String supplier, String supplierOrderId, Long materialId, String material, Integer weightType,
                              Integer carType, String carNo, Long storageId, Double supplierGross, Double supplierNetWeight,
                              Double supplierTare, String supplierCode, Double realGross, Double realNetWeight, Double gross,
                              Double netWeight, Double tare, Double deductWeight, Double hiddenWeight, Double brightWeight,
                              Double displayRate, Integer isPrint, Integer isDisplay, String inDevice, String outDevice,
                              Date inTime, Date outTime, Date printTime, Integer isAuto, Integer isBill, Integer isCheck,
                              String checker, Integer isFinance, String finance, Long invoiceId, Integer isStore) {
        this.orgId = orgId;
        this.supplierId = supplierId;
        this.code = code;
        this.openid = openid;
        this.driver = driver;
        this.phone = phone;
        this.supplier = supplier;
        this.supplierOrderId = supplierOrderId;
        this.materialId = materialId;
        this.material = material;
        this.weightType = weightType;
        this.carType = carType;
        this.carNo = carNo;
        this.storageId = storageId;
        this.supplierGross = supplierGross;
        this.supplierNetWeight = supplierNetWeight;
        this.supplierTare = supplierTare;
        this.supplierCode = supplierCode;
        this.realGross = realGross;
        this.realNetWeight = realNetWeight;
        this.gross = gross;
        this.netWeight = netWeight;
        this.tare = tare;
        this.deductWeight = deductWeight;
        this.hiddenWeight = hiddenWeight;
        this.brightWeight = brightWeight;
        this.displayRate = displayRate;
        this.isPrint = isPrint;
        this.isDisplay = isDisplay;
        this.inDevice = inDevice;
        this.outDevice = outDevice;
        this.inTime = inTime;
        this.outTime = outTime;
        this.printTime = printTime;
        this.isAuto = isAuto;
        this.isBill = isBill;
        this.isCheck = isCheck;
        this.checker = checker;
        this.isFinance = isFinance;
        this.finance = finance;
        this.invoiceId = invoiceId;
        this.isStore = isStore;
    }

    @Override
    public String toString() {
        return "MainMaterialWeight{" +
                "id=" + id +
                ", orgId=" + orgId +
                ", supplierId=" + supplierId +
                ", code='" + code + '\'' +
                ", openid='" + openid + '\'' +
                ", driver='" + driver + '\'' +
                ", phone='" + phone + '\'' +
                ", supplier='" + supplier + '\'' +
                ", supplierOrderId='" + supplierOrderId + '\'' +
                ", materialId=" + materialId +
                ", material='" + material + '\'' +
                ", weightType=" + weightType +
                ", carType=" + carType +
                ", carNo='" + carNo + '\'' +
                ", storageId=" + storageId +
                ", supplierGross=" + supplierGross +
                ", supplierNetWeight=" + supplierNetWeight +
                ", supplierTare=" + supplierTare +
                ", supplierCode='" + supplierCode + '\'' +
                ", realGross=" + realGross +
                ", realNetWeight=" + realNetWeight +
                ", gross=" + gross +
                ", netWeight=" + netWeight +
                ", tare=" + tare +
                ", deductWeight=" + deductWeight +
                ", hiddenWeight=" + hiddenWeight +
                ", brightWeight=" + brightWeight +
                ", displayRate=" + displayRate +
                ", isPrint=" + isPrint +
                ", isDisplay=" + isDisplay +
                ", inDevice='" + inDevice + '\'' +
                ", outDevice='" + outDevice + '\'' +
                ", inTime=" + inTime +
                ", outTime=" + outTime +
                ", printTime=" + printTime +
                ", isAuto=" + isAuto +
                ", isBill=" + isBill +
                ", isCheck=" + isCheck +
                ", checker='" + checker + '\'' +
                ", isFinance=" + isFinance +
                ", finance='" + finance + '\'' +
                ", invoiceId=" + invoiceId +
                ", isStore=" + isStore +
                '}';
    }
}
